home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / include / php / TSRM / readdir.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-03  |  1.0 KB  |  45 lines

  1. #ifndef READDIR_H
  2. #define READDIR_H
  3.  
  4.  
  5. /*
  6.  * Structures and types used to implement opendir/readdir/closedir
  7.  * on Windows 95/NT.
  8.  */
  9.  
  10. #include <io.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <sys/types.h>
  14.  
  15.  
  16. /* struct dirent - same as Unix */
  17.  
  18. struct dirent {
  19.     long d_ino;                    /* inode (always 1 in WIN32) */
  20.     off_t d_off;                /* offset to this dirent */
  21.     unsigned short d_reclen;    /* length of d_name */
  22.     char d_name[_MAX_FNAME + 1];    /* filename (null terminated) */
  23. };
  24.  
  25.  
  26. /* typedef DIR - not the same as Unix */
  27. typedef struct {
  28.     long handle;                /* _findfirst/_findnext handle */
  29.     short offset;                /* offset into directory */
  30.     short finished;                /* 1 if there are not more files */
  31.     struct _finddata_t fileinfo;    /* from _findfirst/_findnext */
  32.     char *dir;                    /* the dir we are reading */
  33.     struct dirent dent;            /* the dirent to return */
  34. } DIR;
  35.  
  36. /* Function prototypes */
  37. DIR *opendir(const char *);
  38. struct dirent *readdir(DIR *);
  39. int readdir_r(DIR *, struct dirent *, struct dirent **);
  40. int closedir(DIR *);
  41. void rewinddir(DIR *);
  42.  
  43.  
  44. #endif /* READDIR_H */
  45.